<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>HouDun许愿墙</title>
	<link rel="stylesheet" href="com/Css/index.css" />
	<script type="text/javascript" src='com/Js/jquery-1.7.2.min.js'></script>
	<script type="text/javascript" src='com/Js/index.js'></script>
</head>
<body>
	<div id='top'>
		<span id='send'></span>
	</div>
	<div id='main'>
			<?php
				
		  foreach($this->db as $k=>$v){
		  	$baobao='/\[抱抱\]/i';
		  	$v['say']=preg_replace($baobao, '<img src="com/Images/phiz/baobao.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$zhuakuang='/\[抓狂\]/i';
		  	$v['say']=preg_replace($zhuakuang, '<img src="com/Images/phiz/zhuakuang.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$haixiu='/\[害羞\]/i';
		  	$v['say']=preg_replace($haixiu, '<img src="com/Images/phiz/haixiu.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$ku='/\[酷\]/i';
		  	$v['say']=preg_replace($ku, '<img src="com/Images/phiz/ku.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$xixi='/\[嘻嘻\]/i';
		  	$v['say']=preg_replace($xixi, '<img src="com/Images/phiz/xixi.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$taikaixin='/\[太开心\]/i';
		  	$v['say']=preg_replace($taikaixin, '<img src="com/Images/phiz/taikaixin.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$touxiao='/\[偷笑\]/i';
		  	$v['say']=preg_replace($touxiao, '<img src="com/Images/phiz/touxiao.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$qian='/\[钱\]/i';
		  	$v['say']=preg_replace($qian, '<img src="com/Images/phiz/qian.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$huaxin='/\[花心\]/i';
		  	$v['say']=preg_replace($huaxin, '<img src="com/Images/phiz/huaxin.gif" alt="抱抱" />', $v['say']);		  	
		  	
		  	$jiyan='/\[挤眼\]/i';
		  	$v['say']=preg_replace($jiyan, '<img src="com/Images/phiz/jiyan.gif" alt="抱抱" />', $v['say']);		  	
 	
		  	$v['say']=preg_replace($baobao, '<img src="com/Images/phiz/baobao.gif" alt="抱抱" />', $v['say']);		  	
		  	$cv=mt_rand(1, 5);

			 
		  echo <<<h
		  
		  <dl class='paper a{$cv}'>
			<dt>
				<span class='username'>{$v['name']}</span>
				<span class='num'>No.{$k}</span>
			</dt>
			<dd class='content'>{$v['say']}</dd>
			<dd class='bottom'>
				<span class='time'>{$v['time']}</span>
				<a href="index.php?a=redact&key={$k}" class='bianji' style="text-decoration: none;color: #999999;font-size: 12px;">编辑</a>
				<a href="index.php?a=del&key={$k}" class='close'></a>
				
			
			</dd>
			<div id='tupian'><img src="{$v['tupian']}" alt="" /></div>
		</dl>
			
h;
}

		?>
	</div>

	<div id='send-form'>
		
		<p class='title'><span>许下你的愿望</span><a href="" id='close'></a></p>
		<form action="index.php?a=add" name='wish' method="post" enctype="multipart/form-data">
			<p> 
				<input type="file" name="file" id="file" value="" />
				<label for="username">昵称：</label>
				<input type="text" name='username' id='username' />
			</p>
			<p>
				<label for="content">愿望：(您还可以输入&nbsp;<span id='font-num'>50</span>&nbsp;个字)</label>
				<textarea name="content" id='content'></textarea>
				<div id='phiz'>
					<img src="com/Images/phiz/zhuakuang.gif" alt="抓狂" />
					<img src="com/Images/phiz/baobao.gif" alt="抱抱" />
					<img src="com/Images/phiz/haixiu.gif" alt="害羞" />
					<img src="com/Images/phiz/ku.gif" alt="酷" />
					<img src="com/Images/phiz/xixi.gif" alt="嘻嘻" />
					<img src="com/Images/phiz/taikaixin.gif" alt="太开心" />
					<img src="com/Images/phiz/touxiao.gif" alt="偷笑" />
					<img src="com/Images/phiz/qian.gif" alt="钱" />
					<img src="com/Images/phiz/huaxin.gif" alt="花心" />
					<img src="com/Images/phiz/jiyan.gif" alt="挤眼" />
				</div>
			</p>
			<input type="submit" id='send-btn' value=""></input>
		</form>
	</div>
<!--[if IE 6]>
    <script type="text/javascript" src="./Js/iepng.js"></script>
    <script type="text/javascript">
        DD_belatedPNG.fix('#send,#close,.close','background');
    </script>
<![endif]-->
                
                    
</body>
</html>